repo: Fix static delta progress display
authorColin Walters <walters@verbum.org>
Fri, 10 Feb 2017 19:29:54 +0000 (14:29 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 17 Feb 2017 14:58:25 +0000 (14:58 +0000)
commite1118e320d6c71a9b678b1dee395687889d51422
tree6be80d12b5a268e755d70e041f2be19cc793e9d9
parent0142e5ff393d4fc9e781d22cfea2e68a95a69dae
repo: Fix static delta progress display

There were a few bugs here.

- We need to keep track of the size of the delta parts we've already processed,
  in order to make progress reliable at all in the face of interruptions.  Add
  a new `fetched-delta-part-size` async progress variable for this.
- The total before disregarded what we'd already downloaded, which was confusing.
  Now, a progress percentage is `fetched/total`.
- Correctly handle "unknown bytes/sec" in the progress display.

However, to be fully correct we need to show the fallback objects too. That
would require tracking in the pull code when we fetch an object as a fallback
versus "normally". This would be simpler really if we could assume in a run we
were *only* processing a delta, but currently we don't do that.

Related: https://github.com/ostreedev/ostree/issues/475

Closes: #678
Approved by: giuseppe
src/libostree/ostree-repo-pull.c
src/libostree/ostree-repo.c
src/ostree/ot-builtin-pull.c